<%@page language="java" contentType="text/html; charset=UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="shortcut icon" type="image/ico" href="http://gd.10086.cn/group/favicon1.ico">
	<script type="text/javascript">
        window.ydHswCfg={};
        window.ydHswCfg.webBase='/group';
    </script>

    <title>成员订单查询</title>
    
    <link href="http://gd.10086.cn/simis/NGADCECPortal/Content/ligerui/ligerui-icons.css" rel="stylesheet" type="text/css" />
    <link href="http://gd.10086.cn/simis/NGADCECPortal/Content/ligerui/Silvery/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="http://gd.10086.cn/simis/NGADCECPortal/Content/NewTheme.css" rel="stylesheet" type="text/css" />
    <link href="http://gd.10086.cn/simis/NGADCECPortal/Content/reset.css" rel="stylesheet" type="text/css" />
    <link href="http://gd.10086.cn/simis/NGADCECPortal/Content/jquery-ui-1.8.2.custom.css" rel="stylesheet" type="text/css" />
    <script src="http://gd.10086.cn/simis/NGADCECPortal/Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="http://gd.10086.cn/simis/NGADCECPortal/Scripts/jquery.json-2.2.min.js" type="text/javascript"></script>
    <script src="http://gd.10086.cn/simis/NGADCECPortal/Scripts/ligerui/ligerui.all.js" type="text/javascript"></script>
    <script src="http://gd.10086.cn/simis/NGADCECPortal/Scripts/jquery.validate.min.js" type="text/javascript"></script>
    <script src="http://gd.10086.cn/simis/NGADCECPortal/Scripts/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
    <script src="http://gd.10086.cn/simis/NGADCECPortal/Scripts/jquery-ui.min.js" type="text/javascript"></script>
    <script src="http://gd.10086.cn/simis/NGADCECPortal/Scripts/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
    <script src="http://gd.10086.cn/simis/NGADCECPortal/Scripts/adc.main.js" type="text/javascript"></script>
    <script src="http://gd.10086.cn/simis/NGADCECPortal/Scripts/datePicker/WdatePicker.js" type="text/javascript"></script>
	<script src="index_files/data.js" type="text/javascript"></script>
	
	

    <script type="text/javascript">
        var clsMainMaster = function () {
            return {
                sHeadUrl: '/simis/NGADCECPortal/'
            };
        } ();

    </script>
    <script type="text/javascript">
    </script>
    <script type="text/javascript">
        /*javascript对象扩展*/

        /*添加时间戳*/
        String.prototype.urlstamp = function () {
            var template = "{0}?_t={1}";
            if (this.indexOf("?") != -1) {
                template = "{0}&_t={1}";
            }
            return String.format(template, this, Date.stamp());
        };

        /*附加参数*/
        String.prototype.urlappend = function (paras) {
            var ps = new Array();
            for (var i in paras) {
                ps.push(i + "=" + escape(paras[i]));
            }
            var template = "{0}?{1}";
            if (this.indexOf("?") != -1) {
                template = "{0}&{1}";
            }
            return String.format(template, this, ps.join("&"));
        };

        /*字符串格式化*/
        String.format = function (fmt) {
            var params = arguments;
            var pattern = /{{|{[1-9][0-9]*}|\x7B0\x7D/g;
            return fmt.replace(
                pattern,
                function (p) {
                    if (p == "{{") return "{";
                    return params[parseInt(p.substr(1, p.length - 2), 10) + 1];
                }
            );
        };

        /*时间戳*/
        Date.stamp = function () {
            return Date.parse(new Date());
        };
    </script>
</head>
<body>


<script type="text/javascript">
    var clsMemberBatchImportQuery = function () {
        return {
            Grid: null, //列表
            fnInit: function () {
                //列表
                $("#MemberBatchImportQueryGrid").ligerGrid({
                    enabledSort:false,
                    columns: [
                        { display: '操作类型', name: 'opttype', width: 60 },
                        { display: '订单日期', name: 'applytime', width: 125 },
                        { display: '赠送日期', name: 'ordertime', width: 125 },
                        { display: '手机号码', name: 'membernumber', width: 80 },
                        { display: '新增的套餐', name: 'addfee', width: 120, render: function (row) {
                            return '<span title="'+row.addfee+'">'+row.addfee+'</span>';
                        }},
                        { display: '修改的套餐', name: 'modifyfee', width: 120, render: function (row) {
                            return '<span title="' + row.modifyfee + '">' + row.modifyfee + '</span>';
                        }
                        },
                        { display: '删除的套餐', name: 'deletefee', width: 120, render: function (row) {
                            return '<span title="' + row.deletefee + '">' + row.deletefee + '</span>';
                        }
                        },
                        { display: '分配的流量', name: 'flow', width: 65 },
                        { display: '生效方式', name: 'effectiverule', width: 60 },
                        { display: '生效周期', name: 'effectivecycle', width: 60 },
                        { display: '订单状态', name: 'applystatus', width: 70 }
                    ],
                    dataAction: "server",
                    pageSize: 20,
                    //url: '/simis/NGADCECPortal/MemberApplyQuery/GetMemberApplyList?ecorderid=' + '1435094',
                    url:'<%=request.getContextPath()%>/moblie/moblieAction!ajaxPortalSearch.action',
                    onAfterShowData: function (grid) {
                        if ($(".l-grid-row", grid).length == 0) {
                            adc.showGridMsg({ grid: "#MemberBatchImportQueryGrid", msg: "<div style='text-align:center;'>暂无数据！</div>" });
                        }
                    },
                    onError: function () {
                        adc.showGridError({ grid: "#MemberBatchImportQueryGrid", msg: "网络繁忙请稍候再试！" });
                    },

                    detail: { onShowDetail: clsMemberBatchImportQuery.showDetails }
                });
                clsMemberBatchImportQuery.Grid = $("#MemberBatchImportQueryGrid").ligerGetGridManager();
            }, //fnInit
            showDetails: function (row, detailPanel, callback) {
                var attr = row.Attrs;
                if (attr && attr.Rows && attr.Rows.length > 0) {
                    var grid = document.createElement('div');
                    $(detailPanel).append(grid);
                    var $g2 = $(grid).css('margin', 10).ligerGrid({
                        columns: [
                            { display: '资费套餐', name: 'product', width: 250 },
                            { display: '属性名', name: 'attrcode', width: 250 },
                            { display: '属性值', name: 'attrvalue', width: 250 }
                        ],
                        isScroll: false,
                        showToggleColBtn: false,
                        width: '98%',
                        usePager: false,
                        enabledSort: false,
                        showTitle: false,
                        columnWidth: 100,
                        dataAction: "local",
                        data: attr,
                        frozen: false
                    });
                } else {
                    $(detailPanel).append("<div style='padding-left:380px; color:red'>暂无属性</div>");
                }
            },
            //查询
            fnMemberBatchImportQueryFilter: function () {
                var mobile = $.trim($("#UserMobile").val());
                if (mobile != "" && !/^(13[\d]|14[5|7]|15[^4a-zA-Z]|18[^14a-zA-Z])\d{8}$/.test(mobile)) {
                    alert("手机号码格式不正确");
                    return false;
                }
                var begintime = $.trim($('#ApplyBeginTime').val());
                var endtime = $.trim($('#ApplyEndTime').val());
                if (begintime != "" && endtime != "" && begintime > endtime) {
                    alert('订单开始时间不能大于结束时间');
                    return false;
                }
                clsMemberBatchImportQuery.Grid.setOptions({
                    parms: [
                        { name: 'searchValue.membernumber', value: mobile },
                        { name: 'searchValue.opttype', value: $.trim($("#OptType").val()) },
                        { name: 'searchValue.applystatus', value: $.trim($("#ApplyStatus").val()) },
                        { name: 'searchValue.applybeginTime', value: begintime },
                        { name: 'searchValue.applyendTime', value: endtime }
                    ]
                });
                clsMemberBatchImportQuery.Grid.changePage('first'); //进行条件查询时,把翻页工具条重置为第一页
                clsMemberBatchImportQuery.Grid.loadData(true);
                return true;
            },
            exportExcel: function () {
                var mobile = $.trim($("#UserMobile").val());
                var begintime = $.trim($('#ApplyBeginTime').val());
                var endtime = $.trim($('#ApplyEndTime').val());
                var OptType = $.trim($("#OptType").val());
                var ApplyStatus = $.trim($("#ApplyStatus").val());
                location.href = "<%=request.getContextPath()%>/moblie/moblieAction!export.action";
            }
        };
    } ();

    $(function () {
        clsMemberBatchImportQuery.fnInit();
        $("#ApplyBeginTime").ligerDateEditor();
        $("#ApplyEndTime").ligerDateEditor();
        if ("-1" != "-1") {
            alert("导出任务已启动,请耐心等待!任务完成将邮件通知您,请留意邮箱!");
        }
    });

</script>

<div class="orderDetail" style="width: auto;">
    <div class="orderDetail_title">
        <b>成员批量导入查询
        </b>
    </div>
    <div class="mod_ctt">
        <div class="blank_15">
        </div>
        <div class="table_ctn">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="normal-table des-table tL">
                <thead>
                    <tr>
                        <th colspan="4">成员批量导入查询
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <th>手机号码:
                        </th>
                        <td>
                            <input type="text" id="UserMobile" name="UserMobile" value="" />
                        </td>
                        <th>操作类型:
                        </th>
                        <td>
                            <select id="OptType" name="OptType">
                                <option value="">全部</option>
                                <option value="新增">新增</option>
                                <option value="修改">修改</option>
                                <option value="删除">删除</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>订单状态:
                        </th>
                        <td colspan="3">
                            <select id="ApplyStatus" name="ApplyStatus">
                                <option value="">全部</option>
                                <option value="处理成功">处理成功</option>
                                <option value="处理失败">处理失败</option>
                                <option value="ESOP处理中">ESOP处理中</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>订单时间:
                        </th>
                        <td colspan="3">
                            <div class="dateWrap">
                                <div class="datePeriod">
                                    <input id="ApplyBeginTime" name="ApplyBeginTime" type="text" value="" />
                                </div>
                                <span class="txt">至
                                </span>
                                <div class="datePeriod">
                                    <input id="ApplyEndTime" name="ApplyEndTime" type="text" value="" />
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <div class="searchBtn_ctn" style="text-align: right">
                                <a id="linkSearchMemberBatchImportQuery" href="#" class="od_btn" onclick="javascript:clsMemberBatchImportQuery.fnMemberBatchImportQueryFilter();">查询</a>
                                <a href="#" class="od_btn" onclick="javascript:clsMemberBatchImportQuery.exportExcel();">导出</a>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="blank_15">
        </div>
        <div class="table_ctn">
            <div id="MemberBatchImportQueryGrid" style="">
            </div>
        </div>
    </div>
</div>

</body>
</html>
